package com.infoland.afanmall.model.my.adapter;

import android.content.Context;
import android.support.annotation.Nullable;
import android.view.View;
import android.widget.TextView;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.chad.library.adapter.base.entity.MultiItemEntity;
import com.infoland.afanmall.R;
import com.infoland.afanmall.base.util.ToolsKit;
import com.infoland.afanmall.model.my.entity.WlActvEntity;

import java.util.List;

/**
 * 物流详情activity适配器
 */
public class WlActvAdapter extends BaseQuickAdapter<WlActvEntity, BaseViewHolder> {
    private int layoutPosition = 0;
    private Context context;


    public WlActvAdapter(int layoutResId, List data, Context context) {
        super(R.layout.item_wl_xx_msg, data);
        this.context = context;
    }

    @Override
    protected void convert(BaseViewHolder helper, WlActvEntity item) {
        if ((helper.getAdapterPosition() == 0)) {
            ToolsKit.setTextColor(helper.getView(R.id.wl_xian_txt1), "#EC2434");
//            int height = helper.getView(R.id.wl_xian_1).getHeight();
//            ToolsKit.addPadding(helper.getView(R.id.wl_xian)
//                    , 0, height, 0, 0);
            ToolsKit.addMarginDp(helper.getView(R.id.wl_big_yuan), 0, 19, 0, 0);
            helper.getView(R.id.wl_xian_1).setVisibility(View.GONE);
            helper.getView(R.id.wl_small_yuan).setVisibility(View.GONE);
            helper.getView(R.id.split).setVisibility(View.GONE);
            helper.getView(R.id.wl_big_yuan).setVisibility(View.VISIBLE);
        }

        if (this.getData().size() == (helper.getAdapterPosition() + 1)) {
//            int height = helper.getView(R.id.wl_xian_2).getHeight();
//            ToolsKit.addPadding(helper.getView(R.id.wl_xian)
//                    , 0, 0, 0, height);
//            helper.getView(R.id.wl_xian_2).setVisibility(View.GONE);
        }
//        Log.e(TAG, "OptionAdapter  " + item.getItemType());

    }
}
